import request from "@/utils/request";
import type { AdminStats, CourseLikeInfo, DailyCounselCount, DashboardInfo } from "./type";

/*
 * @Author: anxia.ack anchenkai@come-future.com
 * @Date: 2025-05-08 11:06:17
 * @LastEditors: anxia.ack anchenkai@come-future.com
 * @LastEditTime: 2025-05-08 16:03:14
 * @FilePath: /free-learning/src/api/dashbord/index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
const BASE_URL = "/api/v1/dashboard/info";

export const getDashboardInfo = (): Promise<DashboardInfo> => {
  return request.get(BASE_URL + "/geInfo");
};
export const getCourseLikeList = (): Promise<CourseLikeInfo> => {
  return request.get(BASE_URL + "/geCourseLikeInfo");
};

export const getDailyCounselCount = (
  startDate?: string,
  endDate?: string
): Promise<DailyCounselCount[]> => {
  return request.get(`${BASE_URL}/counselCountByDateRange`, {
    params: {
      startDate,
      endDate,
    },
  });
};
export const getAdminDashboardInfo = (): Promise<AdminStats> => {
  return request.get(`${BASE_URL}/adminDashboardInfo`);
};
